<template>
  <div class="shop-parent">
    <div class="top">
      <img :src="shop.logo" />
      <p>{{ shop.name }}</p>
    </div>
    <div class="middle">
      <div class="sell">
        <div>{{ tofix(shop.sells) }}万</div>
        <p>销量</p>
      </div>
      <div class="goodcount">
        <div>{{ shop.goodsCount }}</div>
        <p>全部宝贝</p>
      </div>
      <div class="detail">
        <div v-for="item in shop.score">
          <p>{{ item.name }}</p>
          <p>{{ item.score }}</p>
          <p v-if="item.isBetter" class="height">高</p>
          <p v-else class="low">低</p>
        </div>
      </div>
    </div>
    <div class="botton">
      <div>进店看看</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailShop",
  components: {},
  props: {
    shop: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  mounted() {},
  computed: {},
  methods: {
    tofix(value) {
      value = Number(value) / 10000;
      return value.toFixed(1);
    },
  },
};
</script>

<style lang="css" scoped>
.shop-parent {
  padding: 25px 8px;
  height: 35vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-bottom: 10px solid #f6f6f6;
}
.shop-parent > div {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.shop-parent > div > img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #e6e22e;
  margin: 0 15px;
}
.top {
  font-size: 16px;
  flex: 1;
}
.middle {
  flex: 1.5;
  margin-top: 15px;
  display: flex;
}
.middle > div {
  height: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.middle > div > div {
  font-style: normal;
  font-size: 18px;
  margin-bottom: 8px;
}
.botton {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.botton > div {
  padding: 10px 25px;
  background-color: #f2f5f8;
  border-radius: 40px;
}
.sell {
  width: 28%;
}
.goodcount {
  width: 28%;
  border-right: 1px solid #e6e22e;
}
.detail {
  width: 44%;
  display: flex;
  flex-direction: column;
}
.detail > div {
  padding: 0 15px;
  width: 100%;
  height: 80%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.detail > div > p {
  font-size: 14px;
}
.low {
  font-size: 10px;
  font-family: "微软雅黑";
  border-radius: 10px;
  background-color: #5ea732;
  padding: 2px;
  color: #fff;
}
.height {
  border-radius: 10px;
  font-family: "微软雅黑";
  font-size: 10px;
  background-color: #f13e3a;
  padding: 2px;
  color: #fff;
}
</style>